package models

import "gorm.io/gorm"

type MerchantContent struct {
	gorm.Model
	MerchantId int64  `gorm:"type:int;not null;commit:'商家Id'"`
	OrderId    int64  `gorm:"type:int;not null;commit:'订单Id'"`
	Content    string `gorm:"type:varchar(155);not null;commit:'评论'"`
	Score      int64  `gorm:"type:int;not null;commit:'评分'"`
	Image      string `gorm:"type:varchar(155);not null;commit:'图片'"`
}
type RiderContent struct {
	gorm.Model
	RiderId int64  `gorm:"type:int;not null;commit:'商家Id'"`
	OrderId int64  `gorm:"type:int;not null;commit:'订单Id'"`
	Content string `gorm:"type:varchar(155);not null;commit:'评论'"`
	Score   int64  `gorm:"type:int;not null;commit:'评分'"`
	Image   string `gorm:"type:varchar(155);not null;commit:'图片'"`
}

func (m *MerchantContent) MAdd() error {
	return DB.Create(&m).Error
}
func (r *RiderContent) RAdd() error {
	return DB.Create(&r).Error
}
